/*
 * To change this template, choose Tools | Templates and open the template in
 * the editor.
 */
package eikotrade.javafx.scenes;

import eikotrade.javafx.controlls.GoToButton;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.GridPane;
import javafx.scene.paint.Paint;
import javafx.stage.Stage;
import tc.maas.eikotrade.domain.faces.TransactionFace;

/**
 *
 * @author michel
 */
public class HelloWorldScene extends EikoTradeScene {
    
    private TransactionFace face = new TransactionFace();

    public HelloWorldScene(Group parent, Stage primaryStage, Scene caller) {
        super(parent, primaryStage, caller);
        INIT();
    }

    public HelloWorldScene(Group parent, Paint paint, Stage primaryStage, Scene caller) {
        super(parent, paint, primaryStage, caller);
        INIT();
    }

    public HelloWorldScene(Group parent, double d, double d1, Stage primaryStage, Scene caller) {
        super(parent, d, d1, primaryStage, caller);
        INIT();
    }

    public HelloWorldScene(Group parent, double d, double d1, Paint paint, Stage primaryStage, Scene caller) {
        super(parent, d, d1, paint, primaryStage, caller);
        INIT();
    }

    public HelloWorldScene(Group parent, double d, double d1, boolean bln, Stage primaryStage, Scene caller) {
        super(parent, d, d1, bln, primaryStage, caller);
        INIT();
    }

    private void INIT() {
        GridPane pane = new GridPane();
        Group buttonGroup = new Group();
        setHelloWorldButton(buttonGroup);
        setBackButton(buttonGroup);
        pane.add(buttonGroup, 1, 1);
    }
    
    private void setHelloWorldButton(Group group){
        Button btn = new Button();
        btn.setLayoutX(100);
        btn.setLayoutY(80);
        btn.setText("Hello World");
        btn.setOnAction(new EventHandler<ActionEvent>() {

            public void handle(ActionEvent event) {
                System.out.println(face.test());
            }
        });
        group.getChildren().add(btn);        
    }
    
    private void setBackButton(Group group){
        group.getChildren().add(new GoToButton("back", getCaller(), getPrimaryStage()));
    }
    
    
    
    
}
